//
//  TLPaintView.h
//  KidReading
//
//  Created by telen on 16/5/16.
//  Copyright © 2016年 刘赞黄Telen. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface TLPaintModel : NSObject
@property (nonatomic, strong) UIColor *color;  //颜色
@property (nonatomic, assign) CGFloat lineWidth; //宽度
@property (nonatomic, assign) BOOL isEarser; //橡皮
//数据
@property (nonatomic, strong) NSArray<NSValue*>* points; //CGPoint 点 NSValue；集合 //需要paintModelList:方法来执行渲染
@property (nonatomic, strong) NSDate* createTime;
@end

typedef void(^DidAddPaintModel)(TLPaintModel* pantModel);
@interface TLPaintView : UIView

@property (nonatomic, strong) TLPaintModel* paintModel;
//用来记录已有线条
@property (atomic, strong) NSMutableArray *allLine;
//是否处于点击删除模式
@property (nonatomic, assign) BOOL isClickedToDelModel;
//橡皮 模式
@property (nonatomic, assign) BOOL isEarser;
//渲染的比例 默认 1
@property (nonatomic, assign) CGFloat drawLineRatio;
//block 添加数据回调
@property (nonatomic, strong) DidAddPaintModel didAddPaintModel;

//初始化相关参数
-(void)initPaintView;
//删除所有数据
-(void)clear;
//渲染一组Model;
-(void)paintModelList:(NSArray<TLPaintModel*>*)modelList;

#pragma mark- 测试使用
//unDo操作
-(void)backImage;
//reDo操作
-(void)forwardImage;
//加载测试数据
-(void)readTestData;

@end
